#pragma once


#include "Entity.h"

class player : public Entity {
public:
    bool thrust;

    player()
    {
        name = "player";
    }

    void update()
    {
        if (thrust)
        {
            dx += cos(angle * DEGTORAD) * 0.2;
            dy += sin(angle * DEGTORAD) * 0.2;
        }
        else
        {
            dx *= 0.99;
            dy *= 0.99;
        }

        int maxSpeed = 15;
        float speed = sqrt(dx * dx + dy * dy);
        if (speed > maxSpeed)
        {
            dx *= maxSpeed / speed;
            dy *= maxSpeed / speed;
        }

        x += dx;
        y += dy;

        if (x > WindowsWidth) x = 0; if (x < 0) x = WindowsWidth;
        if (y > WindowsHeight) y = 0; if (y < 0) y = WindowsHeight;
    }

};

